package com.ldg.seckill.client;

import com.alipay.api.AlipayApiException;
import com.ld.pojo.PayAsyncVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @Author: Liudao
 * @Date: 2022-10-22-14:34
 * @Description:
 */
@FeignClient("ldg-order")
public interface OrderClient {
    //1. 返回支付宝页面
    @GetMapping("/order/pay/{type}")
    String pay(@PathVariable("type") int type, String outTradeNo, HttpSession session) throws AlipayApiException;

    //2. 远程同步调用
    @GetMapping("order/orderlist")
    String orderList(Model model, HttpSession session);

    //3.远程异步调用
    @PostMapping("order/payed/notify")
    @ResponseBody
    String payedNotify(PayAsyncVo vo, HttpServletRequest request) throws AlipayApiException;
}
